package Demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-24
 * Time: 22:36
 */
public class Test {
    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        Traingle traingle = new Traingle();

        Shape[] shapes = {cycle,cycle,traingle};
        for(Shape shape : shapes) {
            shape.draw();
        }

        System.out.println("------");
        //Shape shape = new Shape() ;//Shape是抽象的; 无法实例化
        Shape shape = new Cycle();
        shape.draw();

    }
}
